﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ProductListModels>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<%if(Model.Products.Count>0){ %>
<div class="bor_cor mar_t">
    <div class="bar_org" style="text-align:center">
        <%=ViewData["Title"] %>
    </div>         
    <div class="new_point">
        <ul>
            <% if (Model.Products != null && Model.Products.Count() > 0)
               {
                   int index = 0;
                   foreach (var item in Model.Products)
                   {
                       var css = index == Model.Products.Count - 1 ? "bor_none" : string.Empty;
                       index += 1;
            %>
            <li class="<%=css %>">
                <div class="new_point_img">
                    <a href="/product/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Name)%>">
                        <% string imgPath = (item.ImagePath != null && item.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(item.ID, 82, 63, item.ImagePath, Model.ImagePath, Model.ImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
                        <img src="<%=imgPath %>" title="" alt="<%=item.Name %>" width="62" height="55" class="bor_img" />
                    </a>
                </div>
                <div class="new_point_txt">
                   <div>
                        <a href="/product/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Name)%>">
                            <%=Html.Encode(item.Name) %>
                        </a>
                    </div>    
                    <div class="mar_t"><strong class="t_red"> <%=string.Format("{0:0,0}", item.UnitPrice) %> ₫</strong></div>
                </div>   
                <div class="clear"></div>           
            </li>
            <%}
               }%>
        </ul>
    </div>
</div>
<div class="clear">&nbsp;</div>
<%} %>